package com.qingneng.budget.dao;

import java.util.List;
import java.util.Map;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.qingneng.budget.vo.ProjectInfo;
import com.qingneng.budget.vo.ProjectWorkInfo;

public class ProjectInfoDaoImpl  extends SqlMapClientDaoSupport  implements IProjectInfoDao {

	public List querySelective(ProjectInfo bean) {
		List list = getSqlMapClientTemplate().queryForList("qn_db_projectinfo.select_projectinfo_sql",bean);
		return list;
	}

	public Integer querySelectvieTotalCount(ProjectInfo bean) {
		Integer total =  (Integer)getSqlMapClientTemplate().queryForObject("qn_db_projectinfo.select_projectinfo_count_sql",bean);	
		return total;
	}

	public List getChildDetail(Map parameterMap) {
		List list = getSqlMapClientTemplate().queryForList("qn_db_projectinfo.select_project_workinfo_sql",parameterMap);
		return list;
	}

	public int insert(ProjectInfo bean) {
		int keyId = ((Integer)getSqlMapClientTemplate().insert("qn_db_projectinfo.insert_projectinfo_sql",bean)).intValue();
		return keyId;
	}

	public void insertChild(ProjectWorkInfo bean) {
		getSqlMapClientTemplate().insert("qn_db_projectinfo.insert_project_workinfo_sql",bean);
	}

	public void deleteChild(ProjectWorkInfo bean) {
		getSqlMapClientTemplate().delete("qn_db_projectinfo.delete_project_workInfo_sql",bean);
		
	}

	public void delete(ProjectInfo bean) {
		getSqlMapClientTemplate().delete("qn_db_projectinfo.delete_projectInfo_sql",bean);
		
	}
	
	public void deleteChildByParentId(ProjectWorkInfo bean) {
		getSqlMapClientTemplate().delete("qn_db_projectinfo.delete_project_workInfo_by_projectInfo_id_sql",bean);
		
	}

	public void updateChild(ProjectWorkInfo bean) {
		getSqlMapClientTemplate().update("qn_db_projectinfo.update_project_workinfo_sql", bean);
		
	}

	public void update(ProjectInfo bean) {
		getSqlMapClientTemplate().update("qn_db_projectinfo.update_projectinfo_sql", bean);
		
	}
	
	

}
